<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Promise微任务处理复杂任务</title>
  </head>
  <body></body>
  <script>
    async function hd(num) {
      let res = await Promise.resolve().then(() => {
        let count = 0;
        for (let i = 0; i < num; i++) {
          count += num--;
        }
        return count;
      });
      console.log(res);
    }
    hd(987654321);
    console.log("houdunren");
  </script>
</html>
